<template>
  <div>
    <div class="detail-content-img">
      <img v-for="(item,index) in imgs" :src="item.url" :key="item.url" alt="" @click.stop="viewPicture(index)">
    </div>
    <imgDialog ref="imgDialog" :imgs="imgs"/>
  </div>
</template>
<script>
import imgDialog from './modules/imgDialog'

export default {
  name: 'ImgList',
  components: { imgDialog },
  props: {
    imgs: {
      type: Array,
      required: true
    }
  },
  methods: {
    viewPicture(index) {
      this.$refs.imgDialog.dialog = true
      this.$refs.imgDialog.$refs.imgCarousel.setActiveItem(index)
    }
  }
}
</script>
<style scoped>
</style>
